from django.conf.urls.defaults import *
from people.models import *


person_list = {
  'queryset': Person.objects.all(),
}
person_type_list = {
  'queryset': PersonType.objects.all(),
}


urlpatterns = patterns('',
  url(
    regex   = '^types/(?P<slug>[-\w]+)/$',
    view    = 'django.views.generic.list_detail.object_detail',
    kwargs  = person_type_list,
    name    = 'person_type_detail',
  ),
  url (
    regex   = '^types/$',
    view    = 'django.views.generic.list_detail.object_list',
    kwargs  = person_type_list,
    name    = 'person_type_list',
  ),
  url(
    regex   = '^(?P<slug>[-\w]+)/$',
    view    = 'django.views.generic.list_detail.object_detail',
    kwargs  = person_list,
    name    = 'person_detail',
  ),
  url (
    regex   = '^$',
    view    = 'django.views.generic.list_detail.object_list',
    kwargs  = person_list,
    name    = 'person_list',
  ),
)